package org.stripesbook.article.view;

import org.stripesbook.article.action.ActivateActionBean;
import org.stripesbook.article.action.LoginActionBean;
import org.stripesbook.article.action.RegisterActionBean;
import org.stripesbook.rayures.view.ViewObject;
import org.stripesbook.rayures.view.stripes.SForm;
import org.stripesbook.rayures.view.stripes.SLink;
import org.stripesbook.rayures.view.stripes.SPassword;
import org.stripesbook.rayures.view.stripes.SSubmit;
import org.stripesbook.rayures.view.stripes.SText;

public class LoginView extends ViewObject<LoginView> {

  public SForm getForm() {
    return tag(ExampleForm.class).beanclass(LoginActionBean.class)
      .addInput(tag(SText.class).name("user.username"), "Username")
      .addInput(tag(SPassword.class).name("user.password"), "Password")
      .addButton(tag(SSubmit.class).name("login").value("Login"));
  }

  public SLink getRegisterLink() {
    return tag(SLink.class).beanclass(RegisterActionBean.class)
      .label("Register here");
  }

  public SLink getActivateLink() {
    return tag(SLink.class).beanclass(ActivateActionBean.class)
      .label("Activate here");
  }
}
